<include file="Public:header" />
<div class="headbar">
    <div class="position"><span>商品</span><span>></span><span>商品管理</span><span>></span><span>商品回收站</span></div>
    <div class="operating">
        <a href="{:U('Goods/goods_list')}"><button class="operating_btn" type="button"><span class="return">返回列表</span></button></a>
        <a href="javascript:void(0);"><button class="operating_btn" onclick="selectAll('id[]')" type="button"><span class="sel_all">全选</span></button></a>
        <a href="javascript:void(0);"><button class="operating_btn" onclick="goods_recycle_del()" type="button"><span class="delete">彻底删除</span></button></a>
        <a href="javascript:void(0);"><button class="operating_btn" onclick="goods_recycle_restore()" type="button"><span class="recover">还原</span></button></a>
    </div>
</div>

<form action="" method="post" name="orderForm">
    <div class="content">
        <table class="list_table">
            <colgroup>
                <col width="40px" />
                <col width="350px" />
                <col width="100px" />
                <col width="70px" />
                <col width="70px" />
                <col width="70px" />
                <col width="80px" />
                <col width="70px" />
            </colgroup>

            <thead>
                <tr>
                    <th>选择</th>
                    <th>商品名称</th>
                    <th>分类</th>
                    <th>销售价</th>
                    <th>库存</th>
                    <th>品牌</th>
                    <th>排序</th>
                    <th>操作</th>
                </tr>
            </thead>

            <tbody>
            <foreach name='goods' item='item'>
                <tr>
                    <td><input name="id[]" type="checkbox" value="{$item['id']}" /></td>
                    <td><a href="{:U('Site/home',array('id'=> $item[id]))}" target="_blank" title="{$item['name']}">{$item['name']}</a></td>
                    <td>
                        
                    </td>
                    <td>{$item['sell_price']}</td>
                    <td>{$item['store_nums']}</td>
                    <td>{$item['brand_name']}</td>
                    <td>{$item['sort']}</td>
                    <td>
                        <a href="{:U('Goods/goods_edit',array('id'=> $item[id]))}" title="编辑"><img class="operator" src="__PUBLIC__/Operation/images/admin/icon_edit.gif" alt="编辑" /></a>
                        <a href="javascript:void(0)" onclick="delModel({link:'{:U('Goods/goods_recycle_del',array('id'=> $item[id]))}'})" title="删除"><img class="operator" src="__PUBLIC__/Operation/images/admin/icon_del.gif" alt="删除" /></a>
                    </td>
                </tr>
            </foreach>
            </tbody>
        </table>
    </div>
</form>
{$page}

<script type="text/javascript">
    function goods_recycle_del()
    {
        $("form[name='orderForm']").attr('action',"{:U('Goods/goods_recycle_del')}");
        confirm('确定要彻底删除所选中的信息吗？','formSubmit(\'orderForm\')');
    }

    function goods_recycle_restore()
    {
        var flag = 0;
        $('input:checkbox[name="id[]"]:checked').each(
        function(i)
        {
            flag = 1;
        }
    );
        if(flag == 0 )
        {
            alert('请选择要还原的数据');
            return false;
        }
        $("form[name='orderForm']").attr('action',"{:U('Goods/goods_recycle_restore')}");
        confirm('确定要还原删除所选中的信息吗？','formSubmit(\'orderForm\')');
    }
</script>
<include file="Public:footer" />